------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  D:\Data\share\bds2020psrm\bds2020psrm.log
  log type:  text
 opened on:   4 Mar 2020, 09:02:06

. 
. /*              ********************************************************************    */
. /*      File Name:              bds2020psrm.do                                                                              
>     */
. /*      Date:                   February 28, 2020                                                                           
>     */
. /*      Author:                 Frederick J. Boehmke                                                                    */
. /*      Purpose:                Replicate analysis of filibuster and crisis duration    */
. /*                                              duration reported in Tables 1 and 2 and Figure 2.               */
. /*                                              in Boehmke, Dion, and Shipan (2020, PSRM).                              */
. /*      Input File:             bds2020psrm-filibuster.dta                                                              */
. /*                                              bds2020psrm-crises                                                          
>                     */
. /*      Output File:    bds2020psrm.log                                                                                 */
. /*                                              bds2020psrm-filib-alltstar.txt                                              
>     */
. /*                                              bds2020psrm-filib-loglik.dta                                                
>     */
. /*                                              bds2020psrm-TXMY.ster                                                       
>             */
. /*                                              bds2020psrm-table01.txt                                                     
>             */
. /*                                              bds2020psrm-table02.txt                                                     
>             */
. /*                                              bds2020psrm-figure02.gph                                                    
>             */
. /*                                              bds2020psrm-figure02.gph                                                    
>             */
. /*              Requires:               warofatt.ado,                                                                       
>             */
. /*                                              estout.ado                                                                  
>                             */
. /*              ********************************************************************    */
. 
.         /**********************************************/
.         /* Uncomment to install needed Stata add-ons. */
.         /**********************************************/
. 
.         
. *ssc install estout
. *net install warofatt, from(https://myweb.uiowa.edu/fboehmke/stata/)
.         
. 
.         /********************************************************************************/
.         /* This provides a Weibull MLE for proper likelihood ratio tests with warofatt. */
.         /********************************************************************************/
. 
.         
. program define wblreg
  1. 
.         args lnf theta1 theta2
  2. 
.         tempvar lambda1 durdep
  3. 
.         quietly gen double `lambda1'    = exp(`theta1')
  4.         quietly gen double `durdep'     = exp(`theta2')
  5.         
.         quietly replace `lnf' = `theta1' + ln(`durdep') + (`durdep'-1)*ln(`lambda1'*$ML_y1) ///
>                                 - (`lambda1'*$ML_y1)^`durdep'
  6. 
. end

. 
.         
.         /**************************************/
.         /**************************************/
.         /* Do the analysis of the filibuster. */
.         /**************************************/
.         /**************************************/
.         
.                 /* Read in the replication data from Dion, Boehmke, MacMillan and Shipan. */
. 
. use bds2020psrm-filibuster, clear
((US Senate filibuster durations (Dion, Boehmke, MacMillan and Shipan N.d. JLE))

.         
.                 /* Label the variables we use to make the table look nicer. */
.         
.         label variable days                     "Filibuster Length"

.         label variable yesbinder                "High Importance Policy"

.         label variable unclearbinder    "Unclear Importance Policy"

.         label variable post1975                 "1875 and After"

. 
.         
.         /***************************************/
.         /* Run the models reported in Table 1. */
.         /***************************************/
. 
.         
.                 /* Start with the basic Weibull models. Use our likelihood to get */
.                 /* comparable log-likelihood values for ests between Weibull and warofatt.  */
.         
.                 /* Model 1. */
.         
. ml model lf wblreg (days = ) /ln_p, robust

. 
.         ml maximize

initial:       log pseudolikelihood =      -2522
alternative:   log pseudolikelihood = -1130.3786
rescale:       log pseudolikelihood = -1090.4047
rescale eq:    log pseudolikelihood = -888.86302
Iteration 0:   log pseudolikelihood = -888.86302  
Iteration 1:   log pseudolikelihood = -878.40654  
Iteration 2:   log pseudolikelihood = -877.62452  
Iteration 3:   log pseudolikelihood = -877.62273  
Iteration 4:   log pseudolikelihood = -877.62273  

                                                Number of obs     =        274
                                                Wald chi2(0)      =          .
Log pseudolikelihood = -877.62273               Prob > chi2       =          .

------------------------------------------------------------------------------
             |               Robust
        days |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
eq1          |
       _cons |  -2.275638   .0573445   -39.68   0.000    -2.388032   -2.163245
-------------+----------------------------------------------------------------
ln_p         |
       _cons |   .1306759   .0608208     2.15   0.032     .0114694    .2498825
------------------------------------------------------------------------------

. 
.                 /* Calculate the adjusted AIC to add to the table. */
. 
.         estadd scalar aic_adj = -2*e(ll) + 2*e(k)

added scalar:
            e(aic_adj) =  1759.2455

. 
.         estimates store T1M1

.         estimates save bds2020psrm-T1M1, replace
file bds2020psrm-T1M1.ster saved

. 
.                 /* Model 2. */
.         
. ml model lf wblreg (days = yesbinder unclearbinder post1975) /ln_p, robust

. 
.         ml maximize

initial:       log pseudolikelihood =      -2522
alternative:   log pseudolikelihood = -1130.3786
rescale:       log pseudolikelihood = -1090.4047
rescale eq:    log pseudolikelihood = -888.86302
Iteration 0:   log pseudolikelihood = -888.86302  
Iteration 1:   log pseudolikelihood =  -847.3918  
Iteration 2:   log pseudolikelihood = -842.00415  
Iteration 3:   log pseudolikelihood = -841.95585  
Iteration 4:   log pseudolikelihood = -841.95584  

                                                Number of obs     =        274
                                                Wald chi2(3)      =      50.24
Log pseudolikelihood = -841.95584               Prob > chi2       =     0.0000

-------------------------------------------------------------------------------
              |               Robust
         days |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
eq1           |
    yesbinder |  -.4858776    .188153    -2.58   0.010    -.8546506   -.1171045
unclearbinder |  -.3051237   .2056606    -1.48   0.138    -.7082112    .0979638
     post1975 |    .766086   .1311723     5.84   0.000     .5089931    1.023179
        _cons |  -2.351868   .2067521   -11.38   0.000    -2.757095   -1.946642
--------------+----------------------------------------------------------------
ln_p          |
        _cons |   .2770138    .054046     5.13   0.000     .1710856     .382942
-------------------------------------------------------------------------------

. 
.         estadd scalar aic_adj = -2*e(ll) + 2*e(k)

added scalar:
            e(aic_adj) =  1693.9117

. 
.         estimates store T1M2

. 
.                 /* Model 3: Specify the war of attrition model without covariates. */
.                 /* This plots the hazard and saves the log-likelihood results for */
.                 /* each value of t* so we can plot them later. */
.         
. warofatt days, robust startvalues iterate(50) difficult ///
>         saveloglik(bds2020psrm-filib-loglik, replace)

Performing MLE for requested values of t*
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
x..............................x..

Iteration 0:   log pseudolikelihood = -928.56502  (not concave)
Iteration 1:   log pseudolikelihood = -843.84544  (not concave)
Iteration 2:   log pseudolikelihood = -841.69353  (not concave)
Iteration 3:   log pseudolikelihood = -839.22623  
Iteration 4:   log pseudolikelihood = -838.56221  
Iteration 5:   log pseudolikelihood = -838.43286  
Iteration 6:   log pseudolikelihood = -838.43274  
Iteration 7:   log pseudolikelihood = -838.43274  



War of attrition duration model, t*=9           Number of obs     =        274
                                                Wald chi2(0)      =          .
Log pseudolikelihood = -838.43274               Prob > chi2       =          .

------------------------------------------------------------------------------
             |               Robust
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Weak         |
       _cons |  -1.943032   .1442561   -13.47   0.000    -2.225769   -1.660295
-------------+----------------------------------------------------------------
StrongStrong |
       _cons |  -2.772075   .0890746   -31.12   0.000    -2.946658   -2.597492
-------------+----------------------------------------------------------------
logit_pi     |
       _cons |  -.3172643   .1911772    -1.66   0.097    -.6919648    .0574361
-------------+----------------------------------------------------------------
      ln_p_W |   .7275874   .0764349     9.52   0.000     .5777778    .8773971
         p_W |    2.07008   .1582264    13.08   0.000     1.782074    2.404633
------------------------------------------------------------------------------
     ln_p_SS |   .1932157   .0829863     2.33   0.020     .0305655    .3558659
        p_SS |   1.213144   .1006744    12.05   0.000     1.031037    1.427416
------------------------------------------------------------------------------
(Nontruncated) Weibull density evaluated at t*: .81593878
------------------------------------------------------------------------------

.         
.         estadd scalar aic_adj = -2*e(ll) + 2*(e(k) + 1)

added scalar:
            e(aic_adj) =  1688.8655

. 
.         estimates store T1M3

.         estimates save bds2020psrm-T1M3, replace
file bds2020psrm-T1M3.ster saved

.         
.                 /* Model 4: Now add covariates in two equations. */
.         
. warofatt days yesbinder unclearbinder post1975, probss(yesbinder unclearbinder post1975) /// 
>         robust startvalues iterate(50) difficult

Performing MLE for requested values of t*
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
x..............................x..

Iteration 0:   log pseudolikelihood = -978.26031  (not concave)
Iteration 1:   log pseudolikelihood = -892.03576  
Iteration 2:   log pseudolikelihood =  -887.7441  
Iteration 3:   log pseudolikelihood = -868.82284  
Iteration 4:   log pseudolikelihood =  -836.5597  
Iteration 5:   log pseudolikelihood = -817.42599  
Iteration 6:   log pseudolikelihood = -813.34172  
Iteration 7:   log pseudolikelihood = -813.13003  
Iteration 8:   log pseudolikelihood =  -813.1282  
Iteration 9:   log pseudolikelihood =  -813.1282  



War of attrition duration model, t*=14          Number of obs     =        274
                                                Wald chi2(3)      =       8.54
Log pseudolikelihood =  -813.1282               Prob > chi2       =     0.0361

-------------------------------------------------------------------------------
              |               Robust
              |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
Weak          |
    yesbinder |  -.4632999   .1588407    -2.92   0.004    -.7746219   -.1519778
unclearbinder |  -.3676265    .163685    -2.25   0.025    -.6884433   -.0468098
     post1975 |   .0132839   .1323951     0.10   0.920    -.2462057    .2727735
        _cons |  -1.484476    .178742    -8.31   0.000    -1.834803   -1.134148
--------------+----------------------------------------------------------------
StrongStrong  |
        _cons |  -3.041717   .1056548   -28.79   0.000    -3.248797   -2.834637
--------------+----------------------------------------------------------------
logit_pi      |
    yesbinder |   1.358667   1.286155     1.06   0.291    -1.162149    3.879484
unclearbinder |   .1822806   1.254744     0.15   0.884    -2.276973    2.641535
     post1975 |  -2.514857   .5938135    -4.24   0.000     -3.67871   -1.351004
        _cons |  -.5039404   1.208749    -0.42   0.677    -2.873045    1.865164
--------------+----------------------------------------------------------------
      ln_p_W |   .7323909    .076631     9.56   0.000     .5821969    .8825849
         p_W |   2.080048   .1593962    13.05   0.000     1.789966     2.41714
------------------------------------------------------------------------------
     ln_p_SS |   .3085616   .1005597     3.07   0.002     .1114683     .505655
        p_SS |   1.361465   .1369085     9.94   0.000     1.117918    1.658071
------------------------------------------------------------------------------
(Nontruncated) Weibull density evaluated at t*: .99998396
------------------------------------------------------------------------------

. 
.         estimates store T1M4

.         estimates save bds2020psrm-T1M4, replace
file bds2020psrm-T1M4.ster saved

.   
.         estadd scalar aic_adj = -2*e(ll) + 2*(e(k) + 1)

added scalar:
            e(aic_adj) =  1650.2564

.         
.                 /* Test equality between policy importance coefficients by equation. */
. 
.         lincom [Weak]_b[yesbinder] - [Weak]_b[unclearbinder]

 ( 1)  [Weak]yesbinder - [Weak]unclearbinder = 0

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -.0956733   .1167694    -0.82   0.413    -.3245371    .1331904
------------------------------------------------------------------------------

.         lincom [logit_pi]_b[yesbinder] - [logit_pi]_b[unclearbinder]

 ( 1)  [logit_pi]yesbinder - [logit_pi]unclearbinder = 0

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |   1.176387    .624168     1.88   0.059      -.04696    2.399733
------------------------------------------------------------------------------

.         
.         
.         /**********************************************************/
.         /* Do chi2 tests for model fit. Note that the critical    */
.         /* value needs to be adjusted via the chi-bar correction. */
.         /**********************************************************/
. 
. 
. lrtest T1M3 T1M1, force

Likelihood-ratio test                                 LR chi2(3)  =     78.38
(Assumption: T1M1 nested in T1M3)                     Prob > chi2 =    0.0000

. lrtest T1M4 T1M2, force

Likelihood-ratio test                                 LR chi2(6)  =     57.66
(Assumption: T1M2 nested in T1M4)                     Prob > chi2 =    0.0000

. 
.    
.         /************************************************************/
.         /* This runs the model separately for each value of t* in   */
.         /* order to save those results to compare parameter values.     */
.         /************************************************************/
. 
.                 /* Fractional values of tstar work, but add nothing since */
.                 /* classification is based on integer realizations in the data. */
.   
. levelsof days, local(levdays)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 21 23 24 25 26 30 32 34 38 40 43 44 47 83 97

. 
. foreach tstar of local levdays {
  2. 
.   capture warofatt days, tstarvalues(`tstar') startvalues iterate(50) difficult
  3. 
.   if e(converged) == 1 {
  4. 
.         display in green `tstar'
  5.         
.         quietly estadd scalar aic_adj = -2*e(ll) + 2*(e(k) + 1)
  6.         
.         estimates store tstar_`tstar'_all
  7.           
.         }
  8. 
.   else {
  9.   
.         display in red `tstar'
 10. 
.         }
 11.         
.   }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
21
23
24
25
26
30
32
34
38
40
43
44
47
83
97

. 
.     
.         /*****************************************************************/
.         /* Create table 1 and a table comparing across all values of t*. */
.         /*****************************************************************/
. 
. 
. estout T1M1 T1M2 T1M3 T1M4 ///
>         using bds2020psrm-table01.txt, ///
>         cells(b(star fmt(3)) se(par)) ///
>         starlevels(* 0.10 ** 0.05) ///
>         equations(1:1:1:1 , 2:2:4:4) ///
>         order(#1: #2: StrongStrong: ln_p_SS: logit_pi:) ///
>         eqlabels("Weak Hazard" "Weak Dur. Dep." "SS Hazard" "SS Dur. Dep." "Probability Cured") ///
>         stats(N ll tstarmax Fwtstar aic aic_adj, fmt(0 2 0 4 2 2)) ///
>         label modelwidth(11) varwidth(30) ///
>         varlabels(_cons constant) ///
>         style(tab) replace
(output written to bds2020psrm-table01.txt)

.         
. estout tstar_*_all ///
>         using bds2020psrm-filib-alltstar.txt, ///
>         cells(b(star fmt(2)) se(par) ) starlevels(* 0.10 ** 0.05) ///
>         stats(N ll tstarmax Fwtstar aic aic_adj, fmt(0 2 0 4 2 2)) ///
>         label modelwidth(6) varwidth(30) ///
>         eqlabels(Weibull "Duration Dependence" Exponential "Probability Cured") ///
>         varlabels(_cons constant) ///
>         style(tab) replace
(output written to bds2020psrm-filib-alltstar.txt)

. 
.         
.         /**********************************************/
.         /* Figure 2: Graph the final log-likelihoods. */
.         /**********************************************/
. 
. 
. use bds2020psrm-filib-loglik, clear
((US Senate filibuster durations (Dion, Boehmke, MacMillan and Shipan N.d. JLE))

. 
.                 /* Identify the maximum value of the reported */
.                 /* log-likelihoods across all candidates values of t*. */
. 
.   quietly sum ll_value if ll_convg == 1 & ll_iters < ll_maxiters

. 
.                 /* Now find the smallest value of t* that produces the maximum LL. */
.   
.         quietly sum ll_tstar if ll_value == r(max)

.         local tstar_max = r(min)

.         levelsof ll_tstar if ll_conv!=1 & ll_iters==ll_maxiters & ll_tstar<50
2 3 4 5 6

.         
.   twoway connected ll_value ll_tstar if ll_conv==1 & ll_iters<ll_maxiters & ll_tstar<50, scheme(s1mono) ///
>         lcolor(gs0) mcolor(gs0) ///
>         xtitle(t*) ///
>         xlabel(0 `tstar_max' 20 30 40 50) ///
>         xtick(0(10)50) ///
>         xtick(`r(levels)', tposition(inside) tlwidth(medthin) tlength(*1.5)) ///
>         ytitle(Final Log-likelihood) ///
>         ylabel(#6, grid) ///
>         xline(`tstar_max', lpattern(dash) lwidth(thin)) ///
>         saving(bds2020psrm-figure02, replace)
(file bds2020psrm-figure02.gph saved)

. 
. 
.         /**************************************/
.         /**************************************/
.         /* Do the analysis of crisis length.  */
.         /**************************************/
.         /**************************************/
. 
.                 /* Read in the replication data from DeRouen and Goldfinch. */
. 
. import excel using bds2020psrm-crises.xls, clear firstrow case(lower)

. 
.         generat logrelcap = ln(relcap)
(1 missing value generated)

. 
.                 /* label the variables we use to make the table look nicer. */
.         
.         label variable sevvio           "Violence"

.         label variable trgterra         "Crisis Duration"

.         label variable logrelcap        "Log Relative Cap."

.         label variable contig           "Contiguity"

.         label variable ethnic           "Ethnic"

.         label variable terr             "Territory"

.         label variable dyaddem3         "Joint Democracy"

.         label variable socun            "Social Unrest"

.         label variable rival            "Rivals"

. 
. 
.         /************************************/
.         /* Run the various specifications.      */
.         /************************************/
. 
.                 /* Start with the basic Weibull models. Use our likelihood to get */
.                 /* comparable log-likelihood values for ests between Weibull and warofatt.  */
.         
.                 /* Model 1. */
.         
. ml model lf wblreg (trgterra = ) /ln_p, robust

. 
.         ml maximize

initial:       log pseudolikelihood =     -88929
alternative:   log pseudolikelihood = -9813.9533
rescale:       log pseudolikelihood = -4935.1226
rescale eq:    log pseudolikelihood =  -4120.425
Iteration 0:   log pseudolikelihood =  -4120.425  
Iteration 1:   log pseudolikelihood = -4113.9125  
Iteration 2:   log pseudolikelihood = -4043.6652  
Iteration 3:   log pseudolikelihood = -4042.6972  
Iteration 4:   log pseudolikelihood = -4042.6951  
Iteration 5:   log pseudolikelihood = -4042.6951  

                                                Number of obs     =        699
                                                Wald chi2(0)      =          .
Log pseudolikelihood = -4042.6951               Prob > chi2       =          .

------------------------------------------------------------------------------
             |               Robust
    trgterra |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
eq1          |
       _cons |  -4.686836   .0516911   -90.67   0.000    -4.788149   -4.585524
-------------+----------------------------------------------------------------
ln_p         |
       _cons |  -.2486623   .0248553   -10.00   0.000    -.2973777   -.1999469
------------------------------------------------------------------------------

. 
.         estadd scalar aic_adj = -2*e(ll) + 2*e(k)

added scalar:
            e(aic_adj) =  8089.3903

. 
.         estimates store T2M1

.         estimates save bds2020psrm-T2M1, replace
file bds2020psrm-T2M1.ster saved

.     
. ml model lf wblreg (trgterra =  sevvio logrelcap dyaddem3 contig rival ethnic terr socun) /ln_p, robust

. 
.         ml maximize

initial:       log pseudolikelihood =     -87132
alternative:   log pseudolikelihood = -9560.0305
rescale:       log pseudolikelihood = -4776.5853
rescale eq:    log pseudolikelihood = -3990.6975
Iteration 0:   log pseudolikelihood = -3990.6975  
Iteration 1:   log pseudolikelihood = -3881.2048  
Iteration 2:   log pseudolikelihood =  -3876.049  
Iteration 3:   log pseudolikelihood = -3876.0371  
Iteration 4:   log pseudolikelihood = -3876.0371  

                                                Number of obs     =        674
                                                Wald chi2(8)      =      60.17
Log pseudolikelihood = -3876.0371               Prob > chi2       =     0.0000

------------------------------------------------------------------------------
             |               Robust
    trgterra |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
eq1          |
      sevvio |   -.449321   .1019011    -4.41   0.000    -.6490434   -.2495986
   logrelcap |  -.0420164    .037532    -1.12   0.263    -.1155778     .031545
    dyaddem3 |   -.099249   .1806721    -0.55   0.583    -.4533598    .2548618
      contig |   .1735867   .1088662     1.59   0.111    -.0397871    .3869605
       rival |    .034993   .1048529     0.33   0.739    -.1705149     .240501
      ethnic |  -.5841989   .1096961    -5.33   0.000    -.7991993   -.3691986
        terr |  -.0750928   .1083205    -0.69   0.488    -.2873972    .1372115
       socun |  -.0901687   .1060746    -0.85   0.395     -.298071    .1177336
       _cons |   -4.46151   .1215784   -36.70   0.000    -4.699799   -4.223221
-------------+----------------------------------------------------------------
ln_p         |
       _cons |  -.1882784   .0245682    -7.66   0.000    -.2364311   -.1401257
------------------------------------------------------------------------------

. 
.         estadd scalar aic_adj = -2*e(ll) + 2*e(k)

added scalar:
            e(aic_adj) =  7772.0742

. 
.         estimates store T2M2

.     
.                 /* This is the alternate version of this specification that we mention that omits sevvio. */
.         
. ml model lf wblreg (trgterra = logrelcap dyaddem3 contig rival ethnic terr socun) /ln_p, robust

. 
.         ml maximize

initial:       log pseudolikelihood =     -87132
alternative:   log pseudolikelihood = -9560.0305
rescale:       log pseudolikelihood = -4776.5853
rescale eq:    log pseudolikelihood = -3990.6975
Iteration 0:   log pseudolikelihood = -3990.6975  
Iteration 1:   log pseudolikelihood = -3887.1683  
Iteration 2:   log pseudolikelihood = -3885.4933  
Iteration 3:   log pseudolikelihood = -3885.4895  
Iteration 4:   log pseudolikelihood = -3885.4895  

                                                Number of obs     =        674
                                                Wald chi2(7)      =      45.99
Log pseudolikelihood = -3885.4895               Prob > chi2       =     0.0000

------------------------------------------------------------------------------
             |               Robust
    trgterra |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
eq1          |
   logrelcap |  -.0481852   .0375523    -1.28   0.199    -.1217863    .0254158
    dyaddem3 |  -.0051377   .1852146    -0.03   0.978    -.3681516    .3578762
      contig |   .1343797   .1066412     1.26   0.208    -.0746332    .3433927
       rival |   .0986609   .1025969     0.96   0.336    -.1024253    .2997471
      ethnic |  -.6777414   .1090392    -6.22   0.000    -.8914544   -.4640284
        terr |  -.1062107   .1072585    -0.99   0.322    -.3164336    .1040122
       socun |  -.1368783   .1057148    -1.29   0.195    -.3440755     .070319
       _cons |  -4.576775   .1154802   -39.63   0.000    -4.803112   -4.350438
-------------+----------------------------------------------------------------
ln_p         |
       _cons |  -.1966567   .0241686    -8.14   0.000    -.2440263   -.1492871
------------------------------------------------------------------------------

. 
.                 /* Note that with no covariates the Newton-Raphson MLE with the startvalues option */
.                 /* produces a maximum at the largest observed duration. Graphing the hazards shows that */
.                 /* it has effectively flipped the two groups with the SS cdf reaching 1 around t=50 and */
.                 /* the W cdf reaching 1 near 1400. The others all find maxima at 44 or 20 depending on */
.                 /* the starting values (I manually entered them in exploring this). 44 is the best, though. */
.         
. warofatt trgterra, robust startvalues tstarmax(499) iterate(100) difficult

Performing MLE for requested values of t*
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
xxx...x...........................................    50
..................................................   100
.......x..........................................   150
..................................................   200
.......................x...........

Iteration 0:   log pseudolikelihood = -4578.6862  (not concave)
Iteration 1:   log pseudolikelihood = -4042.4447  (not concave)
Iteration 2:   log pseudolikelihood = -4037.3276  (not concave)
Iteration 3:   log pseudolikelihood = -4032.7367  (not concave)
Iteration 4:   log pseudolikelihood = -4029.5266  (not concave)
Iteration 5:   log pseudolikelihood = -4024.2573  (not concave)
Iteration 6:   log pseudolikelihood = -4020.1306  
Iteration 7:   log pseudolikelihood = -4019.8267  
Iteration 8:   log pseudolikelihood = -4019.8228  
Iteration 9:   log pseudolikelihood = -4019.8228  



War of attrition duration model, t*=44          Number of obs     =        699
                                                Wald chi2(0)      =          .
Log pseudolikelihood = -4019.8228               Prob > chi2       =          .

------------------------------------------------------------------------------
             |               Robust
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Weak         |
       _cons |    -2.9374   .1985967   -14.79   0.000    -3.326643   -2.548158
-------------+----------------------------------------------------------------
StrongStrong |
       _cons |   -5.01075   .0654334   -76.58   0.000    -5.138997   -4.882503
-------------+----------------------------------------------------------------
logit_pi     |
       _cons |   1.260012   .2157041     5.84   0.000     .8372396    1.682784
-------------+----------------------------------------------------------------
      ln_p_W |   .4913752   .1159538     4.24   0.000       .26411    .7186405
         p_W |   1.634563   .1895337     8.62   0.000     1.302271    2.051642
------------------------------------------------------------------------------
     ln_p_SS |  -.1080875   .0335123    -3.23   0.001    -.1737703   -.0424047
        p_SS |   .8975491   .0300789    29.84   0.000     .8404899    .9584818
------------------------------------------------------------------------------
(Nontruncated) Weibull density evaluated at t*: .9815253
------------------------------------------------------------------------------

. 
.         estadd scalar aic_adj = -2*e(ll) + 2*(e(k) + 1)

added scalar:
            e(aic_adj) =  8051.6456

. 
.         estimates store T2M3

.         estimates save bds2020psrm-T2M3, replace
file bds2020psrm-T2M3.ster saved

.                 
. warofatt trgterra sevvio logrelcap dyaddem3 contig rival ethnic terr socun, robust startvalues tstarmax(499) ///
>         iterate(100) difficult 

Performing MLE for requested values of t*
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
xx...................................x............    50
...............................................xx.   100
.............x...x....x.....x.....................   150
..................................................   200
.........................x.........

Iteration 0:   log pseudolikelihood =  -3958.331  (not concave)
Iteration 1:   log pseudolikelihood =  -3935.434  (not concave)
Iteration 2:   log pseudolikelihood = -3877.0031  
Iteration 3:   log pseudolikelihood = -3867.0923  
Iteration 4:   log pseudolikelihood = -3857.4201  
Iteration 5:   log pseudolikelihood = -3856.8481  (not concave)
Iteration 6:   log pseudolikelihood = -3856.7303  
Iteration 7:   log pseudolikelihood = -3856.6908  
Iteration 8:   log pseudolikelihood = -3856.6112  
Iteration 9:   log pseudolikelihood = -3856.6104  
Iteration 10:  log pseudolikelihood = -3856.6104  



War of attrition duration model, t*=309         Number of obs     =        674
                                                Wald chi2(8)      =     139.18
Log pseudolikelihood = -3856.6104               Prob > chi2       =     0.0000

------------------------------------------------------------------------------
             |               Robust
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Weak         |
      sevvio |  -1.854233   .3301428    -5.62   0.000    -2.501301   -1.207165
   logrelcap |  -.1723928   .1089721    -1.58   0.114    -.3859742    .0411886
    dyaddem3 |   -.492603   .3636559    -1.35   0.176    -1.205355    .2201495
      contig |   .3943893   .2621709     1.50   0.132    -.1194562    .9082349
       rival |  -.1990052   .2441653    -0.82   0.415    -.6775604    .2795499
      ethnic |  -.4593756   .2532765    -1.81   0.070    -.9557885    .0370372
        terr |  -.0804584   .3238177    -0.25   0.804    -.7151295    .5542126
       socun |  -.3557573   .2344553    -1.52   0.129    -.8152812    .1037667
       _cons |  -3.272909   .4070596    -8.04   0.000    -4.070731   -2.475087
-------------+----------------------------------------------------------------
StrongStrong |
       _cons |  -5.047857   .0991446   -50.91   0.000    -5.242177   -4.853537
-------------+----------------------------------------------------------------
logit_pi     |
       _cons |   .6277061    .277362     2.26   0.024     .0840865    1.171326
-------------+----------------------------------------------------------------
      ln_p_W |   .5040409   .1561169     3.23   0.001     .1980574    .8100244
         p_W |   1.655397   .2584354     6.41   0.000     1.219032    2.247963
------------------------------------------------------------------------------
     ln_p_SS |  -.1586423   .0372031    -4.26   0.000    -.2315591   -.0857255
        p_SS |   .8533015   .0317455    26.88   0.000     .7932958    .9178461
------------------------------------------------------------------------------
(Nontruncated) Weibull density evaluated at t*: 1
------------------------------------------------------------------------------

. 
.         estadd scalar aic_adj = -2*e(ll) + 2*(e(k) + 1)

added scalar:
            e(aic_adj) =  7741.2207

. 
.         estimates store T2M4

. 
.                 /* This is the alternate version of this specification that we mention that omits sevvio. */
.         
. warofatt trgterra logrelcap dyaddem3 contig rival ethnic terr socun, robust startvalues tstarmax(499) ///
>         iterate(100) difficult 

Performing MLE for requested values of t*
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
xx................................................    50
..................x..................x............   100
...........x..x...xx..............................   150
..................................................   200
...........................x.......

Iteration 0:   log pseudolikelihood =  -4375.207  (not concave)
Iteration 1:   log pseudolikelihood = -3909.7915  (not concave)
Iteration 2:   log pseudolikelihood =  -3907.848  (not concave)
Iteration 3:   log pseudolikelihood = -3906.4834  (not concave)
Iteration 4:   log pseudolikelihood = -3905.2652  (not concave)
Iteration 5:   log pseudolikelihood = -3903.3173  (not concave)
Iteration 6:   log pseudolikelihood = -3899.1959  (not concave)
Iteration 7:   log pseudolikelihood = -3898.3784  (not concave)
Iteration 8:   log pseudolikelihood = -3897.3275  (not concave)
Iteration 9:   log pseudolikelihood = -3894.3696  (not concave)
Iteration 10:  log pseudolikelihood = -3894.3467  (not concave)
Iteration 11:  log pseudolikelihood = -3891.0748  
Iteration 12:  log pseudolikelihood = -3889.0221  (not concave)
Iteration 13:  log pseudolikelihood = -3888.0349  (not concave)
Iteration 14:  log pseudolikelihood = -3888.0257  
Iteration 15:  log pseudolikelihood = -3888.0257  (not concave)
Iteration 16:  log pseudolikelihood = -3884.7807  (not concave)
Iteration 17:  log pseudolikelihood = -3879.4347  
Iteration 18:  log pseudolikelihood = -3877.9528  
Iteration 19:  log pseudolikelihood = -3877.3656  
Iteration 20:  log pseudolikelihood = -3877.3493  
Iteration 21:  log pseudolikelihood = -3877.3492  



War of attrition duration model, t*=81          Number of obs     =        674
                                                Wald chi2(7)      =      36.15
Log pseudolikelihood = -3877.3492               Prob > chi2       =     0.0000

------------------------------------------------------------------------------
             |               Robust
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Weak         |
   logrelcap |  -.2393374   .0705564    -3.39   0.001    -.3776255   -.1010494
    dyaddem3 |  -.8867668   .6238294    -1.42   0.155     -2.10945    .3359163
      contig |   .5852738   .2568197     2.28   0.023     .0819164    1.088631
       rival |  -.1242226   .2249291    -0.55   0.581    -.5650756    .3166303
      ethnic |  -.3401073   .2748159    -1.24   0.216    -.8787367     .198522
        terr |  -.1258304   .2527861    -0.50   0.619    -.6212821    .3696212
       socun |   -.229988    .220547    -1.04   0.297    -.6622522    .2022762
       _cons |  -3.758253   .3881199    -9.68   0.000    -4.518954   -2.997552
-------------+----------------------------------------------------------------
StrongStrong |
       _cons |  -5.129072   .0729545   -70.31   0.000    -5.272061   -4.986084
-------------+----------------------------------------------------------------
logit_pi     |
       _cons |   .8161854   .1874849     4.35   0.000     .4487218    1.183649
-------------+----------------------------------------------------------------
      ln_p_W |   .4170838   .0897444     4.65   0.000      .241188    .5929796
         p_W |    1.51753   .1361898    11.14   0.000      1.27276    1.809372
------------------------------------------------------------------------------
     ln_p_SS |   -.078093   .0432088    -1.81   0.071    -.1627808    .0065947
        p_SS |   .9248784   .0399629    23.14   0.000     .8497775    1.006617
------------------------------------------------------------------------------
(Nontruncated) Weibull density evaluated at t*: .92762983
------------------------------------------------------------------------------

.                 
.                 /* Include covariates in both equations. */
.         
. warofatt trgterra sevvio logrelcap dyaddem3 contig rival ethnic terr socun, probss(logrelcap dyaddem3) ///
>         robust startvalues tstarmax(499) iterate(100) difficult 

Performing MLE for requested values of t*
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
xx................................................    50
..............................................x...   100
.x.......x.........x.......................x......   150
..................................................   200
.........................x.........

Iteration 0:   log pseudolikelihood = -3925.2558  (not concave)
Iteration 1:   log pseudolikelihood = -3885.9441  (not concave)
Iteration 2:   log pseudolikelihood = -3876.7442  (not concave)
Iteration 3:   log pseudolikelihood = -3858.3318  
Iteration 4:   log pseudolikelihood = -3858.1861  
Iteration 5:   log pseudolikelihood =  -3857.938  
Iteration 6:   log pseudolikelihood = -3854.9897  
Iteration 7:   log pseudolikelihood = -3854.4221  
Iteration 8:   log pseudolikelihood = -3854.1205  
Iteration 9:   log pseudolikelihood = -3854.1165  
Iteration 10:  log pseudolikelihood = -3854.1165  



War of attrition duration model, t*=308         Number of obs     =        674
                                                Wald chi2(8)      =     140.52
Log pseudolikelihood = -3854.1165               Prob > chi2       =     0.0000

------------------------------------------------------------------------------
             |               Robust
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Weak         |
      sevvio |  -2.111582   .3942488    -5.36   0.000    -2.884296   -1.338869
   logrelcap |  -.0846478    .070923    -1.19   0.233    -.2236543    .0543587
    dyaddem3 |  -.7802934   .3204468    -2.44   0.015    -1.408358   -.1522292
      contig |   .3357409   .2579486     1.30   0.193     -.169829    .8413109
       rival |  -.1833341   .1715632    -1.07   0.285    -.5195919    .1529237
      ethnic |  -.5701925   .1525545    -3.74   0.000    -.8691938   -.2711913
        terr |   .0786214   .2877193     0.27   0.785    -.4852981    .6425409
       socun |  -.1451979   .2497842    -0.58   0.561    -.6347658    .3443701
       _cons |  -3.025672   .2639377   -11.46   0.000     -3.54298   -2.508364
-------------+----------------------------------------------------------------
StrongStrong |
       _cons |  -4.993551     .10961   -45.56   0.000    -5.208382   -4.778719
-------------+----------------------------------------------------------------
logit_pi     |
   logrelcap |   .1922849   .0921467     2.09   0.037     .0116807     .372889
    dyaddem3 |  -.3333522   .8625425    -0.39   0.699    -2.023904      1.3572
       _cons |   1.172701   .3759338     3.12   0.002     .4358841    1.909517
-------------+----------------------------------------------------------------
      ln_p_W |   .6468691   .2564863     2.52   0.012     .1441652    1.149573
         p_W |   1.909553   .4897741     3.90   0.000     1.155075    3.156844
------------------------------------------------------------------------------
     ln_p_SS |  -.1643871   .0400369    -4.11   0.000    -.2428579   -.0859162
        p_SS |   .8484136   .0339678    24.98   0.000      .784383    .9176711
------------------------------------------------------------------------------
(Nontruncated) Weibull density evaluated at t*: 1
------------------------------------------------------------------------------

.                 
.         estadd scalar aic_adj = -2*e(ll) + 2*(e(k) + 1)

added scalar:
            e(aic_adj) =  7740.2329

. 
.         estimates store T2M5

.         estimates save bds2020psrm-T2M5, replace
file bds2020psrm-T2M5.ster saved

. 
.                 /* This is the alternate version of this specification that we mention that omits sevvio. */
.         
. warofatt trgterra logrelcap dyaddem3 contig rival ethnic terr socun, probss(logrelcap dyaddem3) ///
>         robust startvalues tstarmax(499) iterate(100) difficult 

Performing MLE for requested values of t*
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
xx................................................    50
...........x....x.................x...xx....x.....   100
......x..............xx........x.x.x.xx.xxxx......   150
..................................................   200
...........................x.......

Iteration 0:   log pseudolikelihood = -4642.8716  (not concave)
Iteration 1:   log pseudolikelihood =  -3915.109  (not concave)
Iteration 2:   log pseudolikelihood = -3904.3783  (not concave)
Iteration 3:   log pseudolikelihood = -3901.9188  (not concave)
Iteration 4:   log pseudolikelihood = -3897.5571  (not concave)
Iteration 5:   log pseudolikelihood = -3892.3147  (not concave)
Iteration 6:   log pseudolikelihood = -3878.6414  (not concave)
Iteration 7:   log pseudolikelihood = -3877.6636  (not concave)
Iteration 8:   log pseudolikelihood = -3877.0833  (not concave)
Iteration 9:   log pseudolikelihood = -3873.8915  (not concave)
Iteration 10:  log pseudolikelihood = -3873.3086  (not concave)
Iteration 11:  log pseudolikelihood = -3872.8512  
Iteration 12:  log pseudolikelihood = -3872.7253  
Iteration 13:  log pseudolikelihood = -3872.7162  
Iteration 14:  log pseudolikelihood = -3872.7162  



War of attrition duration model, t*=58          Number of obs     =        674
                                                Wald chi2(7)      =      26.76
Log pseudolikelihood = -3872.7162               Prob > chi2       =     0.0004

------------------------------------------------------------------------------
             |               Robust
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Weak         |
   logrelcap |  -.0325562   .0977704    -0.33   0.739    -.2241826    .1590703
    dyaddem3 |  -.8202528   .3617656    -2.27   0.023      -1.5293   -.1112052
      contig |   .3744508   .3832467     0.98   0.329    -.3766989      1.1256
       rival |  -.0854823   .2985158    -0.29   0.775    -.6705626    .4995979
      ethnic |  -1.191343   .6970451    -1.71   0.087    -2.557526    .1748404
        terr |   .4612825   .4475909     1.03   0.303    -.4159795    1.338545
       socun |   .2425881   .2194562     1.11   0.269    -.1875382    .6727144
       _cons |  -3.230429   .2618014   -12.34   0.000    -3.743551   -2.717308
-------------+----------------------------------------------------------------
StrongStrong |
       _cons |  -5.036079   .0883105   -57.03   0.000    -5.209164   -4.862994
-------------+----------------------------------------------------------------
logit_pi     |
   logrelcap |   .2876461   .0932915     3.08   0.002     .1047981    .4704941
    dyaddem3 |  -.2131396   .8901521    -0.24   0.811    -1.957806    1.531526
       _cons |   1.688149   .3804097     4.44   0.000     .9425595    2.433738
-------------+----------------------------------------------------------------
      ln_p_W |   .5862006   .1820975     3.22   0.001     .2292962    .9431051
         p_W |   1.797147    .327256     5.49   0.000     1.257714    2.567943
------------------------------------------------------------------------------
     ln_p_SS |  -.1046243   .0464296    -2.25   0.024    -.1956246   -.0136241
        p_SS |   .9006628   .0418174    21.54   0.000     .8223209    .9864683
------------------------------------------------------------------------------
(Nontruncated) Weibull density evaluated at t*: .98825647
------------------------------------------------------------------------------

.                 
.         
.         /**********************************************************/
.         /* Do chi2 tests for model fit. Note that the critical    */
.         /* value needs to be adjusted via the chi-bar correction. */
.         /**********************************************************/
. 
. 
. lrtest T2M3 T2M1, force

Likelihood-ratio test                                 LR chi2(3)  =     45.74
(Assumption: T2M1 nested in T2M3)                     Prob > chi2 =    0.0000

. lrtest T2M4 T2M2, force

Likelihood-ratio test                                 LR chi2(3)  =     38.85
(Assumption: T2M2 nested in T2M4)                     Prob > chi2 =    0.0000

. lrtest T2M5 T2M2, force

Likelihood-ratio test                                 LR chi2(5)  =     43.84
(Assumption: T2M2 nested in T2M5)                     Prob > chi2 =    0.0000

.     
.     
.         /*******************/
.         /* Create table 2. */
.         /*******************/
. 
. 
. estout T2M1 T2M2 T2M3 T2M4 T2M5 ///
>         using bds2020psrm-table02.txt, ///
>         cells(b(star fmt(3)) se(par)) ///
>         starlevels(* 0.10 ** 0.05) ///
>         equations(1:1:1:1:1 , 2:2:4:4:4) ///
>         eqlabels("Weak Hazard" "Weak Dur. Dep." "SS Hazard" "SS Dur. Dep." "Probability Cured") ///
>         order(#1: #2: StrongStrong: ln_p_SS: logit_pi:) ///
>         stats(N ll tstarmax Fwtstar aic aic_adj, fmt(0 2 0 4 2 2)) ///
>         label varwidth(30) modelwidth(12) ///
>         varlabels(_cons constant) ///
>         style(tab) replace
(output written to bds2020psrm-table02.txt)

. 
. log close
      name:  <unnamed>
       log:  D:\Data\share\bds2020psrm\bds2020psrm.log
  log type:  text
 closed on:   4 Mar 2020, 10:07:47
------------------------------------------------------------------------------------------------------------------------------
